# -*- encoding: utf-8 -*-
"""
@File    : practice.py
@Time    : 2020/10/21 09:47
@Author  : lluyao
@Email   : lluyao61@163.com
@Software: PyCharm
"""
# i_list = [1,2,3,4]
# my_list = ['apple','banana','orange',1,3.14,False,i_list]
# print(my_list[-4:-1])
# print(my_list[-4:-1])
# print(my_list[-4:-1])
# print(my_list[-4:-1])
# print(my_list[-4:-1])
#
#
# print(my_list[-4:-1])
# print(my_list[-1:-4])
# print(my_list[-1:-4:-1])
# print(my_list[2:5])
# print(my_list[3:6])

# my_list = ['apple','banana','orange',1,3.14]
# print(my_list)
# fruit = slice (0,3,1)
# print(type(fruit))
# print(my_list[fruit])

# my_list = ['apple','banana',123,0.1111,'cali']
# print(my_list[1:])
# print(my_list[2:6])
# print(my_list[1:-3])
# print(my_list[0])
# print(my_list[4])
# print(my_list[-1:-2:-1])
# for i in my_list:
#     print(i,end=' ')

# my_list = ['apple','banana',123,0.1111,'cali']
# my_list.append('lluyao')
# print(my_list)
# my_list1=[1,2,3]
# my_list.append(my_list1)
# print(my_list)
# 输出：
# ['apple', 'banana', 123, 0.1111, 'cali', 'lluyao']
# ['apple', 'banana', 123, 0.1111, 'cali', 'lluyao', [1, 2, 3]]


# my_list = ['apple','banana','orange',1,3.14,False]
# my_list.insert(1,True)
# print(my_list)
# 输出：
# ['apple', True, 'banana', 'orange', 1, 3.14, False]


# my_list = ['apple','banana','orange',1,3.14,False]
# my_list1=[1,2,3]
# print(my_list+my_list1)
# my_list2=['a','b','c']
# my_list.extend(my_list2)
# print(my_list)
# 输出：
# ['apple', 'banana', 'orange', 1, 3.14, False, 1, 2, 3]
# ['apple', 'banana', 'orange', 1, 3.14, False, 'a', 'b', 'c']


# my_list = ['apple','banana','orange',1,3.14,False]
# my_list1=[1,2,3]
# for i,j in enumerate(my_list):
#     print(f'列表中的第{i+1}个元素-->{j}')


# lst = [3,2,7,4,5,9]
# target = 9
# result = list()
# for i,j in enumerate(lst):
#     for x in range(i+1,len(lst)):
#         if j+lst[x] == target:
#             result.append(i)
#             result.append(x)
# print(result)
# user_input = input("please input your nuns:")
# target = input("please input your target:")
# nums = user_input.split(',')
# result = list()
# for i,j in enumerate(nums):
#     for x in range(i+1,len(nums)):
#         if int(j)+int(nums[x]) == int(target):
#             result.append(i)
#             result.append(x)
# print(result)

# print('欢迎使用用户检测系统')
# user_pwd = [('root','123456'),('admin','admin')]
# username = input('请输入用户名：')
# password = input('请输入密码：')
# user_input = (username,password)
# print('登录成功') if user_input in user_pwd  else print('登陆失败')

# singer_song = {True:'痴心绝对','张韶涵':'阿刁','汪峰':'普通disco','汪峰':'当我想起你的时候'}
# singer_song.get('123','lalala')
# print(singer_song.get('张韶涵'))
# print(singer_song)

# my_dict = {'name':'song',5:'1'}
# singer_song.update(my_dict)
# print(singer_song)
# my_dict.update(singer_song)
# print(my_dict)
# company={ 'BOSS':'唐僧','CTO':'悟空','CFO': '八戒',  '搬砖':'沙僧', '苦力':'白龙马' }
# print(company['CTO'])
# print(company['BOSS'])
# for i,j in company.items():
#     print(f'{i}是{j}')
# for item in range(2):
#     x = input('please input:')
#     print(f'{x}在company中') if x in company.values() else print(f'{x}不在company中')

# print('欢迎使用用户检测系统')
# ls = [('root', '123456'), ('admin', 'admin')]
# name_ls = list()
# for username,password in ls:
#     name_ls.append(username)
# while True:
#     name = input("请输入用户名(退出：quit)：")
#     if name == 'quit':
#         break
#     elif name in name_ls:
#         secret = input("请输入密码：")
#         if (name,secret) in ls:
#             print("登录成功")
#         else:
#             print("密码错误")
#     else:
#         print("用户名错误")





# user_ls = [('root', '123456'), ('admin', 'admin')]
# user_dict = dict(user_ls)

# while True:
#     name = input("请输入用户名(退出：quit)：")
#     if name == 'quit':
#         break
#     else:
#         for username in user_dict:
#             if name == username:
#                 secret = input('请输入密码：')
#                 if secret == user_dict[username]:
#                     print('登录成功')
#                     break
#                 else:
#                     print('密码错误')
#                     break
#             else:
#                 print('用户名错误')
#                 break


str = 'assdncbdnxjskhfsuehfiownivuerehfcbfiehwbiogharoenfejdnvue'
str_set = set(str)
str_dict = dict()
for i in str_set:
    str_dict[i]=str.count(i)
for i,j in str_dict.items():
    print(f'{i}出现了{j}次')





